<?php

/**
 * User form.
 *
 * @package    zzz
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class UserForm extends BaseUserForm
{
  public function configure()
  {
      unset($this['id'],$this['created_at'],$this['updated_at'],$this['logged_at'],$this['is_active'], $this['username']);

      
      // WIDGETS
      $this->widgetSchema['email']        = new sfWidgetFormInputText(array(), array('size'=>40));
      $this->widgetSchema['firstname']    = new sfWidgetFormInputText(array(), array('size'=>40));
      $this->widgetSchema['lastname']     = new sfWidgetFormInputText(array(), array('size'=>40));
      $this->widgetSchema['password']     = new sfWidgetFormInputPassword(array(), array('size'=>40));
      $this->widgetSchema['password_comfirm'] = new sfWidgetFormInputPassword(array(), array('size'=>40));
      $this->widgetSchema['mobile']       = new sfWidgetFormInputText(array(), array('size'=>40));
      $this->widgetSchema['is_active']    = new sfWidgetFormInputCheckbox(array(), array('value'=>1));
      $this->widgetSchema['is_admin']     = new sfWidgetFormInputCheckbox(array(), array('value'=>1));
      

      // VALIDATORS
      $this->validatorSchema['fullname']    = new sfValidatorPass();
      $this->validatorSchema['password']    = new sfValidatorPass();
      $this->validatorSchema['password']    = new sfValidatorPass();
      $this->validatorSchema['password_comfirm'] = new sfValidatorPass();
      $this->validatorSchema->setPostValidator(new sfValidatorSchemaCompare('password_comfirm', sfValidatorSchemaCompare::EQUAL, 'password', array(), array('required'=>false, 'invalid' => 'Passwords did not match.')));
      $this->validatorSchema['mobile']      = new sfValidatorPass();
      $this->validatorSchema['is_active']   = new sfValidatorPass();
      $this->validatorSchema['is_admin']    = new sfValidatorPass();
      $this->validatorSchema['email']       = new sfValidatorEmail(array(), array());

      // LABELS      
      $this->widgetSchema->setLabel('email', 'Имэйл');
      $this->widgetSchema->setLabel('firstname', 'Нэр');
      $this->widgetSchema->setLabel('lastname', 'Овог');
      $this->widgetSchema->setLabel('mobile', 'Утас');
      $this->widgetSchema->setLabel('password', 'Нууц үг');
      $this->widgetSchema->setLabel('is_active', 'Идэвхитэй эсэх');
      $this->widgetSchema->setLabel('is_admin', 'Админ эсэх');
  }
  


}